#ifndef _HARD_H_
#define _HARD_H_

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/time.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>

enum cipher_algos
{
	AES = 0x10,
	DES = 0x20,
	DES3 = 0x21,
	ARC4 = 0x30,
	RNG = 0x50,
	SNOW_3G_f8 = 0x60,
	Kasumi = 0x70,
	SM1 = 0x80,
	SM4 = 0x90,
	SSF33 = 0xA0,
	SM6 = 0xB0
};	//need to compate with csec define

enum hash_algos
{
	H_MD5	 = 0x40,
	H_SHA1 = 0x41,
	H_SHA224 = 0x42,
	H_SHA256 = 0x43,
	H_SHA384 = 0x44,
	H_SHA512 =0x45,
	H_SHA0 = 0x46,
	H_SM3 = 0x47,
	H_CRC = 0x90,
	H_S3Gf9 = 0xa0
};	//need to compate with csec define

enum encdec{
	DEC = 0,
	ENC
};	//need to compate with csec define

enum atype{
	CBC = 0x10,
	ECB = 0x20,
	CFB = 0x30,
	CFB1 = 0x31,
	CFB8 = 0x32,
	CFB16 = 0x33,
	CFB32 = 0x34,
	CFB64 = 0x35,
	OFB = 0x40,
	OFB1 = 0x41,
	OFB8 = 0x42,
	OFB16 = 0x43,
	OFB32 = 0x44,
	OFB64 = 0x45,
	CTR = 0x00,
	CCM = 0x80,
};	//need to compate with csec define

enum htype{
	T_HASH = 0x00,
	T_HMAC = 0x01,
	T_SMAC = 0x02,
	T_HMAC_IOPAD = 0x04
};

enum asvalue{
	UPDATA = 0,
	INIT,
	FINAL,
	INITFINAL
};

#define DIR_MASK 		0x01
#define DDONE_MASK		0x02
#define ST_ERR_MASK		0x04
#define AAI_SK	                0x80
#define SPLICTK_MASK	        0x40
#define ST_ERR			0x04

struct cipher_api
{
	unsigned char alg;
	unsigned char type;
	unsigned char as;	//init/updata/final
	unsigned char opt;
	unsigned key_len;
	unsigned iv_len;
	unsigned data_len;
};

struct cipher_ccm_api
{
	unsigned char alg;
	unsigned char auth_m_len;
	unsigned char as;	//init/updata/final
	unsigned char opt;
	unsigned key_len;
	unsigned iv_len;
	unsigned data_len;
};

#define CHEAD_SIZE 16

#define CCP903T_PCIE_MAGIC 'c'

#define ACLASS_MASK 0x70
#define ACLASS_CIPHER	0x00
#define ACLASS_HASH		0x20
#define ACLASS_SNOOP		0x30
#define ACLASS_PKHA		0x40

#define max_crypto_len (1<<_IOC_SIZEBITS)
//#define max_crypto_len 0x600

#define TCNT 1

#define RAND_CNT_MASK 0xf

#endif
